package com.j2some;


import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.yishun.springboot.Application;
import com.yishun.springboot.mapper.GwsCWRMapper;
import com.yishun.springboot.mapper.YzwSubContractorListMapper;
import com.yishun.springboot.pojo.GwsDictListJobName;
import com.yishun.springboot.pojo.GwsProjectAttendanceListNew;
import com.yishun.springboot.pojo.GwsTeamType;
import com.yishun.springboot.pojo.UploadGWSAddTeam;
import com.yishun.springboot.pojo.YzwProjectAttendanceListNew;
import com.yishun.springboot.pojo.YzwSubContractorList;
import com.yishun.springboot.pojo.YzwWorkerList;
import com.yishun.springboot.service.GongWuSuUploadCWSService;
import com.yishun.springboot.service.InnerFormalGWSCWRService;

import lombok.extern.slf4j.Slf4j;

/**
 * 过程测试
 * @date   2021年5月7日上午10:52:51 
 * @author XiaoHuang
 *
 */
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class ProcessTestlitile2 {

	
	@Autowired
	GwsCWRMapper gwsCWRMapper;
	
	
	@Autowired
	InnerFormalGWSCWRService innerFormalGWSCWRService;
	
	@Autowired
	GongWuSuUploadCWSService gongWuSuUploadCWSService;
	
	@Test
	public void uploadPersonnel() throws Exception {
		
//		GwsProjectAttendanceListNew gwsProjectAttendanceListNew = new GwsProjectAttendanceListNew();
//		gwsProjectAttendanceListNew.setGws_projectcode("");
//		gwsProjectAttendanceListNew.setIdcardnumber("");
//		gwsProjectAttendanceListNew.setPassed_time("2021-02-04 09:27:07");
//		
//		gwsCWRMapper.innerOneRecordProjectAttendanceListNew(gwsProjectAttendanceListNew);
//		personnelLeaveProjectByIdCardNumber
//		List<YzwProjectAttendanceListNew> l = gwsCWRMapper.selectAttendancelistnewByIDCardNumberAndTime("332626198007113034", null);
//		log.info(":"+l.size());
		
//		String str = "丰畅木工班";
//		Dictionary dictionary = new Dictionary();
//		String patternStr = dictionary.yzwAndGwsOfTeamDictionary(str);
//		GwsTeamType gwsTeamType = gwsCWRMapper.selectGwsTeamTypeLikeTeamName(patternStr);
//		log.info("gwsTeamType:"+gwsTeamType);
		
//		 String string1 = "我爱编w!@#程  www#";
//		String regEx="[`~!@#$%^&*()+=|{}:;\\[\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“’。，、？a-zA-Z0-9 ]";
//		Pattern c = Pattern.compile(regEx);
//		Matcher mc=c.matcher(string1);
//		while(mc.find()){
//			log.info(mc.group());
//			}
//		String result = mc.replaceAll("").trim();
//		log.info(result);
//		
//		Pattern p = Pattern.compile("[编][程]");
//		Matcher m = p.matcher(result);
//		while(m.find()){
//		log.info(m.group());
//		}
		
		
		
//		String string1 = "丰畅砌筑班";
////		String regEx="[`~!@#$%^&*()+=|{}:;\\[\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“’。，、？a-zA-Z0-9 ]";
//		Pattern c = Pattern.compile("[班]?");
//		Matcher mc=c.matcher(string1);
//		while(mc.find()){
//			log.info(mc.group(mc.end()));
//			}
//		String result = mc.replaceAll("").trim();
//		log.info(result);
		

		Integer yzwProjectCode = 325437;
		List<YzwWorkerList> yl = gwsCWRMapper.selectPresenceOfWorkerList(yzwProjectCode, "iDCardNumber");
//		for (int i = 0; i < yl.size(); i++) {
//			log.info("yl:"+yl.toString());
//		}
		log.info("--------------");
		for (YzwWorkerList yzwWorkerList : yl) {
			log.info("yzwWorkerList:"+yzwWorkerList.toString());
			log.info("-----");
			log.info("yl:"+yl.toString());
		}
		
//		YzwSubContractorList yzwSubContractorList = null;
//		GwsDictListJobName gwsDictListJobName = null;
//		log.info("ylsize:"+yl.size());
//		
//		UploadGWSAddTeam uploadGWSAddTeam = new UploadGWSAddTeam();
//		innerFormalGWSCWRService.addTeamTest(uploadGWSAddTeam);
		
//		for (YzwWorkerList yzwWorkerList : yl) {
//			for (YzwSubContractorList yzwSubContractorList : yzwWorkerList.getYzwSubContractorList()) {
//				log.info("个人id："+yzwWorkerList.getIDCardNumber()+".个人的分包商信息:"+yzwSubContractorList);			
//			}
				
				
//				yzwSubContractorList = yzwWorkerList.getYzwSubContractorList();
//			gwsDictListJobName = yzwWorkerList.getGwsDictlistJobname();
//			log.info("gwsDictListJobName:"+gwsDictListJobName);
			
		
//			log.info("分包商信息为空了！");
//			continue;
			
//		}

	}

}